import Vue from 'vue'
import VueRouter, { RouteConfig } from 'vue-router'

const error = () => import('../../vue/components/404.vue')
const Teacher = () => import('../../vue/personal/teacher/Teacher.vue')


Vue.use(VueRouter)

const base = '/home'

const routes = <RouteConfig[]>[
  { path: `${base}/`, redirect: `${base}/teacherlist` }, 
  { path: `${base}/teacherlist`, name: 'Teacher', component: Teacher },
  { path: '*', name: '404', component: error }
]


const Router = new VueRouter({
  mode: 'history',
  routes: routes,
  scrollBehavior(to, from, savedPosition) {
    return { x: 0, y: 0 }
  }
})

export default Router